package object1;

public class Dog {
    private String name;    //姓名
    private String color;   //颜色

    public void barks(){
        System.out.println(name + ":旺旺旺~");
    }

    public void wag(){
        System.out.println(name + ":摇尾巴~");
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public static void main(String[] args) {
        Dog dog1 = new Dog();
        dog1.setName("小黑");
        dog1.setColor("黑色");
        dog1.barks();
        dog1.wag();

        Dog dog2 = new Dog();
        dog2.setName("大黄");
        dog2.setColor("黄色");
        dog2.barks();
        dog2.wag();
    }
}
